/*
 * @Author: xiehangyun 
 * @Date: 2025-05-16 18:15:40 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2025-09-11 15:27:06
 */

import { makeAutoObservable } from "mobx";
import issueCouponApi from "./issueCouponApi";

class IssueCouponStore {

    constructor() {
        makeAutoObservable(this, {}, { deep: false });
        this.getCouponTypes();// 初始化时获取所有可用的券类型列表
    }

    // 所有可用的券类型列表
    couponTypes: Array<{
        couponTypeId: number,
        typeName: string,
    }> = [];
    getCouponTypes = async () => {
        const res = await issueCouponApi.getCouponTypes();
        if (res.code === 200) {
            this.couponTypes = res.data;
        }
    }


};

const issueCouponStore = new IssueCouponStore();

export default issueCouponStore;